import requests
import time
import requests

headers = {
    # "Authorization":"session.1221344937852575358",
    # "device_id":"cd791be3-2df0-3f0c-a137-9b0a4c8a796a",
    "User-Agent":"Dalvik/1.6.0 (Linux; U; Android 4.4.2; OPPO R11 Build/NMF26X) Resolution/720*1280 Version/5.24.1 Build/5240205 Device/(OPPO;OPPO R11)",
    "shield":"d19ada2641d2560f23d2f156692e6a42",
    "Host":"www.xiaohongshu.com",
}

data = {
    # "userids": "565fedfacb35fb4552e5ee16",
    "userids": "58988ddc50c4b40bf93413c0",
    "platform": "Android",
    "deviceId": "cd791be3-2df0-3f0c-a137-9b0a4c8a796a",
    "device_fingerprint": "201809121411034abaed68357e498f045ae5b48365dfea019f44c63e626860",
    "device_fingerprint1": "201809121411034abaed68357e498f045ae5b48365dfea019f44c63e626860",
    "versionName": "5.24.1",
    "channel": "xiaohongshu",
    "sid": "session.1221344937852575358",
    "lang": "zh-Hans",
    "t": 1538206513,
    "sign": "b632131ca98e98787049a4577ba23f0c",
}

xhs_url = 'https://www.xiaohongshu.com/api/sns/v1/user/follow'
response = requests.post(xhs_url, data=data, headers=headers, verify=False)
print(response.text)